package com.ruoyi.system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.RushTaskMapper;
import com.ruoyi.system.domain.RushTask;
import com.ruoyi.system.service.IRushTaskService;

/**
 * 抢购任务Service业务层处理
 *
 * @author ruoyi
 * @date 2024-12-23
 */
@Service
public class RushTaskServiceImpl implements IRushTaskService {
    @Autowired
    private RushTaskMapper rushTaskMapper;

    /**
     * 查询抢购任务
     *
     * @param id 抢购任务主键
     * @return 抢购任务
     */
    @Override
    public RushTask selectRushTaskById(Long id) {
        return rushTaskMapper.selectRushTaskById(id);
    }

    /**
     * 查询抢购任务列表
     *
     * @param rushTask 抢购任务
     * @return 抢购任务
     */
    @Override
    public List<RushTask> selectRushTaskList(RushTask rushTask) {
        return rushTaskMapper.selectRushTaskList(rushTask);
    }

    /**
     * 新增抢购任务
     *
     * @param rushTask 抢购任务
     * @return 结果
     */
    @Override
    public int insertRushTask(RushTask rushTask) {
        return rushTaskMapper.insertRushTask(rushTask);
    }

    /**
     * 修改抢购任务
     *
     * @param rushTask 抢购任务
     * @return 结果
     */
    @Override
    public int updateRushTask(RushTask rushTask) {
        return rushTaskMapper.updateRushTask(rushTask);
    }

    /**
     * 批量删除抢购任务
     *
     * @param ids 需要删除的抢购任务主键
     * @return 结果
     */
    @Override
    public int deleteRushTaskByIds(Long[] ids) {
        return rushTaskMapper.deleteRushTaskByIds(ids);
    }

    /**
     * 删除抢购任务信息
     *
     * @param id 抢购任务主键
     * @return 结果
     */
    @Override
    public int deleteRushTaskById(Long id) {
        return rushTaskMapper.deleteRushTaskById(id);
    }

    @Override
    public RushTask getLast() {
        return rushTaskMapper.selectLast();
    }

}
